<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="./css/style.css">
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/normalize.css">

    <script src="./js/jquery-3.6.0.min.js"></script>
    <script>
        function exitWin(){
            const flag = confirm("您确定要退出系统嘛？");
            if (flag){
                window.close();
                window.top.location.href="./../login.php?a=logout";
                //清除cookie
            }
        }
    </script>
</head>
<body>
<header>
    <div class="header">
        <div class="wrapper clearfix">
            <div class="head-left">
                <div class="logo"><a href=""><img src="./img/logo.png" alt=""></a></div>
            </div>
            <div class="head-right">
                <nav>
                    <ul class="nav clearfix">
                        <li>欢迎您：<em><?=$_COOKIE['username']?></em></li>
                        <li><a onclick="exitWin()" style="cursor: pointer">用户退出</a></li>
                        <li><a href="./addProOrder.php" target="_blank">购物车</a></li>
                        <li><a href="">我的账户</a></li>
                    </ul>
                </nav>
            </div>
        </div>
    </div>
    <div class="header-nav">
        <div class="wrapper clearfix">
            <nav class="se-nav">
                <div class="clearfix head-nav">
                    <?php if(is_array($category)):
                    foreach($category as $cate): ?>
                    <a href="./product.php?cateId=<?=$cate['id']?>" target="_blank"><?=$cate['category']?></a>
                    <?php  endforeach; endif;?>
                    <a href="./product.php" target="_blank">全部商品目录</a>
                    <div id="indicator"></div>
                </div>
            </nav>
            <div class="search">
                <div class="se-ipt">
                    <input type="text" placeholder="请输入商品">
                </div>
                <div class="se-btn">
                    <button><img src="./img/search-icon.png" alt=""></button>
                </div>
            </div>
        </div>
    </div>
</header>
</body>
</html>